<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <th:block th:include="include :: header('项目方案列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
  <div class="row">
    <div class="col-sm-12">
      <form id="plan-form">
        <input type="hidden" id="projectId" name="projectId" th:value="${projectId}">
      </form>
    </div>
    <div class="col-sm-12 select-table table-striped">
      <table id="bootstrap-table" data-mobile-responsive="true"></table>
    </div>
  </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
  var prefix = ctx + "project/projectPlan";

  $(function () {
    var options = {
      url: prefix + "/plan",
      showFooter: true,
      modalName: "项目方案",
      showSearch:false,
      showRefresh:false,
      columns: [
        {
          field: 'planId',
          title: '项目方案ID',
          visible: false
        },
        {
          field: 'microbialName',
          title: '菌剂名称'
        },
        {
          field: 'planCycle',
          title: '周期'
        },
        {
          field: 'planDosage',
          title: '用量'
        },
        {
          field: 'planPrice',
          title: '预计费用(元)',
          footerFormatter: function (value) {
            var sumPrice = 0;
            for (var i in value) {
              sumPrice += parseFloat(value[i].planPrice);
            }
            return "指导价格：" + sumPrice + "元";
          }
        }]
    };
    $.table.init(options);
  });

  function queryParams(params) {
    var search = $.table.queryParams(params);
    search.projectId = $("#projectId").val();
    return search;
  }
</script>
</body>
</html>